---@class components
---@field kkd_dissect component_kkd_dissect

---@class component_kkd_dissect
local dissect = Class(function(self, inst)
    self.inst = inst 

    self.creatures = {}

end)


function dissect:AddCreature(target)
    
end

function dissect:SetOnDissectFn(name, fn)
    if not self.ondissectfns then self.ondissectfns = {} end 
    self.ondissectfns[name] = fn
end

function dissect:OnDissect(target)
    if self.ondissectfns then 
        for name, fn in pairs(self.ondissectfns) do 
            fn(self.inst, target)
        end
    end

    self:AddCreature(target.prefab)

    target.kkd_deathtime = true
    ErodeAway(target)
end

return dissect 
